// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import FastClick from 'fastclick'
// import VueRouter from 'vue-router'
import router from './router'
import store from './store'
import App from './App'


import '@/assets/css/base.css'
import '@/assets/css/main.css'
import '@/assets/css/iconfont.js'

import {
	LoadingPlugin,
	ToastPlugin,
	ConfigPlugin,
	ConfirmPlugin,
	Swiper,
	SwiperItem
} from 'vux'
Vue.use(LoadingPlugin)
Vue.use(ToastPlugin)
Vue.use(ConfigPlugin)
Vue.use(ConfirmPlugin)
Vue.component('swiper', Swiper)
Vue.component('swiper-item', SwiperItem)


import './http'

FastClick.attach(document.body)

Vue.config.productionTip = false



/* eslint-disable no-new */
new Vue({
    data: store,
    watch: {
        'token': function(val) {
            localStorage.setItem('token', val)
        }
	},
	created() {
		this.$http.get('/app/index/orgInfo').then(json => {
			const { code, company } = json
			if(code === 0) {
				this.orgInfo = company
				document.title = company.companyName
			}
		})
	},
    router,
    render: h => h(App)
}).$mount('#app-box')